<script type="text/javascript">
<!--
$(document).ready(function(){
	$('#reportTypeDropdown').change(function(){
		var v = $(this).context.value;
		if(v.indexOf('b')!=-1){
			window.location = v+'.action';
		}
		
	});	
	
	
	$('#planningExerciseList').change(function(){
		var v = $(this).context.value;
		$.ajax({
			  url: "reporting!ajax.action?planYear="+ v+'&t='+new Date().getTime(),
			  cache: true,
			  dataType: "json",
			  async: false,
			  success: function(data){
//console.log(data);			
//console.log(data.plans);	
//console.log(data.images);
				var plans = data.plans;
				var images = data.images;
				var plen = plans.length;
				var ilen = images.length;
			  	var opt = $("<option></option>");
			  	
				var planSelect = $('#planNameSelect');
				planSelect.children().remove();
				
				planSelect.append($("<option value=''>--Select--</option>"));
				
				for(i=0;i<plen;i++){
					var opt = $("<option></option>");
			  		var p = plans[i];
			  		opt.attr('value',p.desc);  //p.code
			  		opt.text(p.desc);  
			  		planSelect.append(opt);
			  	}
				
//console.log(planSelect);
				var archiveSelect = $('#archiveImage');
				archiveSelect.children().remove();
				archiveSelect.append($("<option value=''>--Select--</option>"));
				for(j=0;j<ilen;j++){
//console.log(j);				
					var a = images[j];
					var iopt = $("<option></option>");
					iopt.attr('value',a.desc);  //a.code
					iopt.text(a.desc);
					archiveSelect.append(iopt);
			  	}
//console.log(archiveSelect);				
			  },
		 	  error: function(data){
			    $("#errorMsgSpan").html(data);
			  }		
		});
		
		
	});
});
//-->
</script>
<tr>
	<td colspan="2"><label class="fLabel">Report Type</label>
		<div class="fField">

			<select style="width: 605px" name="" id="reportTypeDropdown"
				class="inputSelect">
				<option>- Select -</option>

			
					<option value="b1">B1.Detail report of programme plan</option>
					<option value="b4">B4.List of programme</option>
					<option value="b5">B5.Summary report of number of students</option>
					<option value="b15">B15.Projection of tuition fee income</option>
					<option value="b17">B17.Discrepancy report for planned
						figures amended</option>
					<option value="b21">B21. Discipline level submission status
					</option>
						
				<!-- 
<optgroup label="(B) Programme Reports">
				</optgroup>
				
				
				<optgroup label="(A) Corporate Level Plan">
					<option value="1">A1.Detail report of programme plan (B1)</option>
					<option value="2">A2. Target planned place / training hour
						assigned to discipline</option>
					<option value="3">A3. Error report of programme allocated
						to 2 different nodes</option>
					<option value="1">A4. Discrepancy report of assigned
						targets and actual plan</option>
					<option value="1">A5. Reports facilitate finance and
						strategic planning</option>
				</optgroup>
				<optgroup label="(B) Discipline Plan">
					<option value="1">IVE Course Plan By Discipline -
						(MCPP1201R)</option>
					<option value="1">IVE Course Plan By Campus By Disc By
						Mode-Level - (MCPP1202R)</option>
					<option value="1">IVE Course Plan By Campus By Dept By
						Mode-Level - (MCPP1203R)</option>
					<option value="1">List of New Courses To Be Introduced -
						(MCPP1204R)</option>
					<option value="1">Number of Students In IVE By Campus -
						(MCPP1205R)</option>
					<option value="1">Number of Students by Discipline by
						Course Board - (MCPP1206R)</option>
					<option value="1">Number of Year-1 Students In IVE by
						Discipline - (MCPP1207R)</option>
					<option value="1">Number of Final Year Student In IVE By
						Discipline - (MCPP1208R)</option>
					<option value="1">Number of Students by Campus by
						Discipline - (MCPP1209R)</option>
					<option value="1">Number of Students In IVE By Disc By
						Award By Mode - (MCPP1210R)</option>
					<option value="1">Number of Students in IVE by Discipline
						- (MCPP1211R)</option>
					<option value="1">Number of Students By Campus by
						Department - (MCPP1212R)</option>
					<option value="1">List of Course Under Course Board -
						(MCPP1213R)</option>
					<option value="1">Number of Planned New Students in HD by
						Discipline - (MCPP1214R)</option>
					<option value="1">Projection of Tuition fee income for IVE
						and SBI - (MCPP1219R)</option>
					<option value="1">List of CIS Course - (MCPP1220R)</option>
					<option value="1">Discrepancy Report for Planned Place
						Figures Amended - (MCPP1221R)</option>
					<option value="1">Course Plans of Non-Mainstream Courses
						in IVE by Campus - (MCPP1222R)</option>
					<option value="1">Course Plan Details in Curriculum Hours
						of IVE courses - (MCPP1223R)</option>
					<option value="1">Dynamic Course Plan Summary Report (IVE)
						- (MCPP2206bD)</option>
					<option value="1">Dynamic Course Plan Summary Report
						(Level) - (MCPP2207D)</option>
					<option value="1">Dynamic Course Plan Summary Report
						(Mode) - (MCPP2208D)</option>
				</optgroup>
				<optgroup label="TRS Sub-System Reports">
					<option value="1">Course Plan Details - (MCPP2201aR)</option>
					<option value="1">Course Plan Full Details - (MCPP2201dR)
					</option>
					<option value="1">Course Plan Summary - (MCPP2202aR)</option>
					<option value="1">Course Plan Summary by Mode of Study by
						Course Type - (MCPP2203R)</option>
					<option value="1">Course Plan Summary by Mode of Study by
						Level of Study - (MCPP2204R)</option>
					<option value="1">List of TRS Course - (MCPP2209R)</option>
					<option value="1">DVS/TFC/BCC Course Plan Detail Report by
						Campus - (MCPP2210R)</option>
					<option value="1">DVS course plan by campus by Discipline
						- (MCPP2211R)</option>
					<option value="1">Number of Trainee Places and Trainee
						Hours - (MCPP2212R)</option>
					<option value="1">Discrepancy Report for Planned Place
						Figures Amended - (MCPP2215R)</option>
					<option value="1">Dynamic Course Plan Summary Report
						(T&amp;D Centre) - (MCPP2206aD)</option>
				</optgroup>
				<optgroup label="C) OU Plan">
					<option value="1">C1. Detailed programme plan with
						resources allocation</option>
					<option value="1">C2. Summary report of resources
						allocation with different groupings</option>
				</optgroup>
				 -->
			</select>



		</div>
	</td>
</tr>